package cn.controller.marketing;

import cn.service.marketingService.MarketingServiceImpl.FlashSaleActivityServiceImpl;
import entity.marketingEntity.FlashSaleActivity;
import entity.marketingEntity.FlashSaleActivityCondition;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/31 10:04
 */
@RestController
@CrossOrigin
@RequestMapping("/marketing")
public class FlashSaleActivityController {
    @Autowired
    FlashSaleActivityServiceImpl service;
    @RequestMapping("/getflashsaleactivity")
    public Result getflashsaleactivity(@RequestBody FlashSaleActivityCondition condition){
        return service.getflashsaleactivity(condition);
    }
    @RequestMapping("/addflashsaleactivity")
    public Result addflashsaleactivity(@RequestBody FlashSaleActivity flashSaleActivity){
        return service.addflashsaleactivity(flashSaleActivity);
    }
    @RequestMapping("/updateflashsaleactivityOnline")
    public Result updateflashsaleactivityOnline(Integer id,Integer online){
        return service.updateflashsaleactivityOnline(id,online);
    }
    @RequestMapping("/deleteflashsaleactivity")
    public Result deleteflashsaleactivity(Integer id){
        return service.deleteflashsaleactivity(id);
    }
    @RequestMapping("/modifyflashsaleactivity")
    public Result modifyflashsaleactivity(@RequestBody FlashSaleActivity flashSaleActivity){
        return service.modifyflashsaleactivity(flashSaleActivity);
    }
}
